From 2149c3820ff0868bedd10f870e78aed77cc9165a Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 25 Feb 2022 00:38:49 +0100
Subject: [PATCH 08/11] link stage 2 tools dynamically to libstd

stage 2 tools are the ones that are distributed, and we distribute
them together with the rust libs so there is no need to worry
about unstable ABI
---
 src/bootstrap/builder.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index b4fc1d4f2..e1f596ecb 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1906,6 +1906,8 @@ impl<'a> Builder<'a> {
         // linking all deps statically into the dylib.
         if matches!(mode, Mode::Std | Mode::Rustc) {
             rustflags.arg("-Cprefer-dynamic");
+        } else if stage >= 2 {
+            rustflags.arg("-Cprefer-dynamic");
         }
 
         // When building incrementally we default to a lower ThinLTO import limit
-- 
2.39.0

